<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite + Vue + TS</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.ts"></script>
  </body>
  <script>
    (function (win) {
      var doc = win.document;
      var docEl = doc.documentElement;
      var tid;
      function refreshRem() {
        var width = docEl.getBoundingClientRect().width;
        const info = navigator.userAgent;
        var rem = width / 10;
        docEl.style.fontSize = rem + 'px';
      }

      win.addEventListener(
        'resize',
        function () {
          clearTimeout(tid);
          tid = setTimeout(refreshRem, 200);
        },
        false
      );
      win.addEventListener(
        'pageshow',
        function (e) {
          if (e.persisted) {
            clearTimeout(tid);
            tid = setTimeout(refreshRem, 200);
          }
        },
        false
      );
      window.refreshRem = refreshRem;
      refreshRem();
    })(window);
  </script>
</html>
